//
//  SYYJStudentsTableViewCell.m
//  SanYiTeaching
//
//  Created by 郑浩然 on 2019/4/25.
//  Copyright © 2019年 SanYi. All rights reserved.
//

#import "SYYJStudentsTableViewCell.h"


@interface SYYJStudentsTableViewCell ()
@property (weak, nonatomic) IBOutlet UILabel *nameLab;
@property (weak, nonatomic) IBOutlet UIImageView *duicuoImage;

@end


@implementation SYYJStudentsTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setYjstModel:(SYYueJuanShiTiModel *)yjstModel {
    if (yjstModel.isPiGai) {
        _nameLab.textColor = [UIColor colorWithHexString:@"#FF0000"];
        self.duicuoImage.hidden = NO;
        NSString *imageName = nil;
        if ([yjstModel.fenSu isEqualToString:@"1"]) {//对
            imageName = @"yj_pigai_dui";
        } else if ([yjstModel.fenSu isEqualToString:@"2"]) {//半对
            imageName = @"yj_pigai_bandui";
        } else {
            imageName = @"yj_pigai_cuo";
        }
        
        _duicuoImage.image = [UIImage imageNamed:imageName];
    } else {
        self.duicuoImage.hidden = YES;
        _nameLab.textColor = [UIColor colorWithHexString:@"#333333"];
    }
    
    _nameLab.text = yjstModel.studentName;
    
}



- (void)setStudentModel:(SYStudentsModel *)studentModel {
    NSString *imageName = nil;
    if ([studentModel.isRight isEqualToString:@"1"]) {
        imageName = @"yj_pigai_dui";
    } else {
        imageName = @"yj_pigai_cuo";
    }
    _duicuoImage.image = [UIImage imageNamed:imageName];
    _nameLab.text = studentModel.studentName;
}


@end














